home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
- #include <stdlib.h>
- #include <dos.h>
- #include "define.h"
-
- /* ドライブモードの設定 */
- /*
- * decice_no: device number (Towns CD-ROM -> 0)
- * sector_size: セクターサイズ(2048, 2336, or 2340)
- * return: 0 -> 正常終了, 0以外 -> エラー
- */
- int cdr_sdrvmd(int device_no, int sector_size)
- {
- union REGS reg;
-
- reg.h.ah = 0x00;
- reg.h.al = (0xC0 | (u_char) device_no);
- reg.x.cx = 0x0000;
- reg.h.dl = (u_char) sector_size;
-
- int86(0x93, ®, ®);
-
- if (reg.h.ah == 0) {
- return 0;
- } else if (reg.h.ah == 0x02) { /* device number error */
- return DEVERR;
- } else { /* (reg.h.ah == 0x80) hard ware error */
- return reg.x.cx;
- }
- }
-
-